//
//  SZStatusViewModel.m
//  Weibo
//
//  Created by Zahi on 2017/7/31.
//  Copyright © 2017年 Zahi. All rights reserved.
//

#import "SZStatusVM.h"
#import "SZStatus.h"
#import "SZAttentionUser.h"



@interface SZStatusVM()



@end

@implementation SZStatusVM

- (void)setStatus:(SZStatus *)status
{
    _status = status;
    
    // 处理会员等级图片
    [self handleMbrankImage:status.user.mbrank];
    // 处理认证类型图片
    [self handleVerifiedTypeImage:status.user.verified_type];
}

#pragma mark - 处理会员图片
- (void)handleMbrankImage:(int )mbrank
{
    if (mbrank >=1 && mbrank <= 6) {
        
        self.mbrankImage = [UIImage imageNamed:[NSString stringWithFormat:@"common_icon_membership_level%i",mbrank]];
    } else {
        self.mbrankImage = nil;
    }
}


#pragma mark - 处理认证类型图片
- (void)handleVerifiedTypeImage:(int)type
{
    switch (type) {
        case 0:
            
            self.verifiedImage = [UIImage imageNamed:@"avatar_vip"];
            break;
        case 2:
        case 3:
        case 5:
            self.verifiedImage = [UIImage imageNamed:@"avatar_enterprise_vip"];
            break;
            
        case 220:
            self.verifiedImage = [UIImage imageNamed:@"avatar_grassroot"];
            break;
        default:
            self.verifiedImage = nil;
            break;
    }
}

@end
